package qj.tool.gae.dump;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.*;

import qj.util.SwingUtil;
import qj.util.SwingUtil.RowAdder;
import qj.util.funct.P0;

public class DumpUIItem {
	String id;
	Color background;

	JLabel label;
	JComponent pane;
	
	public DumpUIItem(String id) {
		this.id = id;
	}

	public DumpUIItem(String id,Color background) {
		this.id = id;
		this.background = background;
	}

	public P0 onUpload = null;
	public JComponent getComp() {
		label = new JLabel(id);
		
		pane = SwingUtil.panel_horizontal(label, SwingUtil.panel(
				SwingUtil.btn("Upload", onUpload)
				));
		if (background !=null) {
			pane.setBackground(background);
		}
		pane.setPreferredSize(new Dimension(0, 50));
		pane.setBorder(BorderFactory.createRaisedBevelBorder());
		return pane;
	}
	
	
//	,
//	SwingUtil.btn("Special", special())
//	private static P0 special() {
//		return new P0() {public void e() {
//			
//		}};
//	}
}